package cn.com.taiji.oospub.wechat.service.impl;

import cn.com.taiji.oospub.wechat.entity.MemberBmi;
import cn.com.taiji.oospub.wechat.mapper.MemberBmiMapper;
import cn.com.taiji.oospub.wechat.service.IMemberBmiService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yzd
 * @since 2020-12-09
 */
@Service
public class MemberBmiServiceImpl extends ServiceImpl<MemberBmiMapper, MemberBmi> implements IMemberBmiService {
    @Autowired
    private MemberBmiMapper memberBmiMapper;

    @Override
    public List<MemberBmi> getByMemberId(String memberId) {
        QueryWrapper<MemberBmi> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("member_id", memberId);
        queryWrapper.orderByDesc("creat_time");
        return memberBmiMapper.selectList(queryWrapper);
    }
}
